cmake_minimum_required(VERSION 2.8)
cmake_policy(VERSION 2.8)

project (DASHMEM)

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

INCLUDE(FindPTHREAD)

if (NOT ANDROID)
add_definitions (-DDEBUG=1)
else (NOT ANDROID)
add_definitions (-DDEBUG=1)
add_definitions (-DANDROID_DEBUG=1)
endif (NOT ANDROID)

#this is necessary to pick up android flags
if( NOT ANDROID )
set (CMAKE_C_FLAGS " -g -Wall -fPIC")
else ( NOT ANDROID )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -v -Wall -pedantic -g" )
endif ( NOT ANDROID )

IF( NOT CMAKE_BUILD_TYPE )
	SET( CMAKE_BUILD_TYPE "RelWithDebInfo" )
ENDIF()


include_directories ("${DASHMEM_SOURCE_DIR}/inc/")

set (LIBRARY_OUTPUT_PATH ${DASHMEM_BINARY_DIR}/lib)

add_subdirectory ("src")
add_subdirectory ("test")

set (DASHMEM_INCLUDE_FILES
  "${DASHMEM_SOURCE_DIR}/inc/dashmem.h"
)

# display status message for important variables
MESSAGE( STATUS )
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
MESSAGE( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )
MESSAGE( STATUS "Change a value with: cmake -D<Variable>=<Value>" )
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
MESSAGE( STATUS )


